const sequelize = require('./db');


sequelize.onload(() => init())

async function init() {
    const User = sequelize.models.User;
    const jane = await User.create({name: "Jane"});
    // Jane 现在存在于数据库中！
    console.log(jane instanceof User); // true
    console.log(jane.name); // "Jane"
    const users = await User.findAll();
    console.log(users.every(user => user instanceof User)); // true
    console.log("All users:", JSON.stringify(users, null, 2));
}
